﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Itasa.API;
using Itasa.RSS;

namespace Itasa
{
    /// <summary>
    /// Logica di interazione per Control_Download.xaml
    /// </summary>
    public partial class Control_Torrent_Download : UserControl
    {

        private RSS_Torrent link;

        internal Control_Torrent_Download(RSS_Torrent link)
        {
            this.link = link;
            InitializeComponent();
            if (this.link == null)
            {
                this.Button.IsEnabled = false;
                this.ToolTip="Impossibile trovare torrent: " + link.Name;
            }
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Params.dm.downloadTorrent(link);
        }
    }
}
